import java.util.Scanner;

public class Test0602 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String[] users = {"zhangsan", "lisi"};
        String[] passwords = {"123", "456"};
        int[] account = {500, 1000};
        // lisi 重复存取查退
        System.out.println("请输入账号：");
        String iptUsername = scan.next();
        System.out.println("请输入密码：");
        String iptPassword = scan.next();

//        int keepMoney = 0; // 保存用户的钱
        int index = -1;// 保存登录用户的下标

        boolean loginState = false; // 记录登录状态
        for (int i = 0; i < users.length; i++) {
            if (iptUsername.equals(users[i]) && iptPassword.equals(passwords[i])) { // 找到
                loginState = true;
                index = i; // 下标 1
                break;
            }
        }
        if (loginState) {
            System.out.println("欢迎" + iptUsername); // lisi
            System.out.println("请输入：1. 存 2. 取 3. 查 4. 退：");
            int opt = scan.nextInt();
            switch (opt) {
                case 1:
                    System.out.println("请输入存款金额：");
                    int m = scan.nextInt(); // 100
                    account[index] += m;
                    System.out.println("卡上余额 keepMoney：" + account[index]);
                    System.out.println("数组里 account[1]：" + account[1]);
                    break;
                case 2:
                    break;
                case 3:
                    break;
                case 4:
                    break;
            }

        } else {
            System.out.println("查无此人");
        }


//        if (!loginState) {
//            System.out.println("查无此人");
//        }

//        int a = 5;
//        int b = a;
//        System.out.println(a);
//        System.out.println(b);
//        a = 6;
//        System.out.println(a);
//        System.out.println(b);

        /*
         * arr1 = {20, 30, 40}
         * arr2 = {20, 30, 40}
         * 数据类型 两大类 基本数据类型？
         *
         * ？？？？都有各自20 30 40 拷贝
         * */

//        int[] arr1 = {20, 30, 40};
//        int[] arr2 = arr1;
//
//        arr1[0] = 6;
//
//        for (int i = 0; i < arr2.length; i++) {
//            System.out.println(arr2[i]);
//        }

        // 合并
//        int[] arr1 = {20, 30, 40};
//        int[] arr2 = {50, 60};
//
//        int[] newArr = new int[arr1.length + arr2.length];
//
//        int j = 0;
//        for (int i = 0; i < newArr.length; i++) {
//            if (i < arr1.length) {
//                newArr[i] = arr1[i];
//            } else {
//                newArr[i] = arr2[j];
//                j++;
//            }
//        }

        // 下标 取元素 数值
//        for (int i = 0; i < newArr.length; i++) {
//            System.out.println(newArr[i]);
//        }

        // for each
//        for (int item : newArr) {
//            System.out.println(item);
//        }
    }
}
